<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>专利管理</title>
    <#include "layout/import_js.ftl" />
    <#include "layout/import_css.ftl" />
    <script src="../static/js/patent.js"></script>
</head>
<body>
    <#include "layout/header.ftl"/>
    <#include "layout/sidebar.ftl"/>

    <div class="container">
        <div class="raw">
            <div class="panel panel-info">
                <div class="panel-heading">
                    <h3 class="panel-title"><a href="/patent/add">上传专利</a></h3>
                </div>
                <table class="table table-hover table-bordered">
                    <div class="raw">
                        <th class="col-sm-2 ">编号</th>
                        <th class="col-sm-2">名称</th>
                        <th class="col-sm-2">项目名</th>
                        <th class="col-sm-2">作者</th>
                        <th class="col-sm-1">申请日期</th>
                        <th class="col-sm-1">到期日期</th>
                        <th class="col-sm-2">操作</th>
                    </div>

                    <#list patents as item>
                        <tr>
                            <td title="${item.number}">${item.number}</td>
                            <td>${item.name}</td>
                            <td>${item.projectName}</td>
                            <td>${item.authors!"default 无"}</td>
                            <td>${item.applyDate?string('yyyy/MM/dd')}</td>
                            <td>${item.pastDate?string('yyyy/MM/dd')}</td>
                            <td>
                                <a class="btn btn-info" href="/patent/edit?id=${item.id}">编辑</a>
                                <button class="btn btn-danger" data-toggle="confirmation" data-popout="true" id="${item.id}" name="del-patent">
                                    删除
                                </button>
                            </td>
                        </tr>
                    </#list>

                </table>
            </div>
            <nav aria-label="Page navigation">
                <ul class="pagination pagination-lg pull-right">
                    <li>
                        <a href="#" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <#list 1..(page.getTotalPages())!1 as i>
                        <li><a href="/patent?pageIndex=${i}">${i}</a></li>
                    </#list>
                    <li>
                        <a href="#" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>

    <#include "layout/alert.ftl" />
</body>
</html>